//
//  MJOneCollectionViewCell.m
//  NewClothesForEveryDay
//
//  Created by dllo on 15/7/14.
//  Copyright (c) 2015年 蓝天. All rights reserved.
//

#import "MJOneCollectionViewCell.h"
#import "UIImageView+WebCache.h"

@implementation MJOneCollectionViewCell

- (void)dealloc
{
    [_img release];
    [_myLable release];
    [_picUrl release];
    [_labelTitle release];
    [super dealloc];
}
- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        self.img = [[UIImageView alloc] init];
        [self.contentView addSubview:self.img];
//        self.img.backgroundColor = [UIColor redColor];//////
        self.myLable = [[UILabel alloc] init];
        [self.img addSubview:self.myLable];
//        self.myLable.backgroundColor = [UIColor whiteColor];//////
       
    }
    return self;
}
- (void)applyLayoutAttributes:(UICollectionViewLayoutAttributes *)layoutAttributes
{
    self.img.frame = layoutAttributes.bounds;
    self.myLable.frame = CGRectMake(0, self.img.frame.size.height - 20, self.img.frame.size.width, 20);
}

- (void)setLabelAndImg
{
    [self.img setImageWithURL:[NSURL URLWithString:self.picUrl] placeholderImage:[UIImage imageNamed:@"a"]];
    /**
     *  图片失真处理
     */
//    [self.img setContentMode:UIViewContentModeScaleToFill];///////
    self.myLable.text = self.labelTitle;
}


@end
